package com.wanxi.order.mapper;



import com.wanxi.domain.dto.CouponDTO;
import com.wanxi.domain.dto.OrderProductDTO;
import com.wanxi.domain.dto.SkuIdPrice;
import com.wanxi.domain.entity.Order;
import com.wanxi.domain.entity.OrderAll;
import com.wanxi.domain.entity.OrderProduct;
import com.wanxi.domain.vo.OrderQueryVO;
import com.wanxi.domain.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author LiuYuRong
 * @Date 2022/1/4 9:38
 * @Version 1.0
 * @Description
 */
@Mapper
public interface OrderMapper {
    int selectOrderById(long id);

    List<OrderVO> getOrdersByShopId(@Param("roleId") long roleId,  @Param("vo") OrderQueryVO vo, @Param("userIdList") List<String> userIdList, @Param("couponIdList") List<String> couponIdList);

    Long addOrder(Order orderE);

    int addProduct(OrderProduct product);

    int updateOrder(@Param("orderId") long orderId,@Param("col") String col ,@Param("val") Object val);


    int deleteOrderById(@Param("orderId") long orderId);

    int addProducts(OrderProductDTO dtos);

    int getOrderCol(@Param("col") String col,@Param("orderId") long orderId);

    List<String> getUserIdByUserName(@Param("username") String username);

    List<String> getCouponIdByCouponType(@Param("couponType") String couponType);

    List<SkuIdPrice> getPriceBySkuIdList(List<Long> priceList);

    CouponDTO getCouponById(@Param("couponId") long couponId);

    int insertIntoOrderAll(OrderAll orderAll);

    List<OrderVO> getOrdersByEnterpriseId(@Param("roleId") Long roleId,@Param("page") int page,@Param("pageSize") int pageSize);

    List<OrderVO> getOrdersByUserId(@Param("userId") Long userId,@Param("page") int page,@Param("pageSize") int pageSize);

    List<Long> getOrdersBypid(@Param("id") long id);


//    子查询
}
